export default {
  namespaced: true,
  state: () => ({
    token: localStorage.getItem("token") || "",
    userInfo: JSON.parse(localStorage.getItem("userInfo")) || {},
  }),
  actions: {
     setToken:(store,token)=>{
         store.commit("SET_TOKEN",token)
     },
     setUserInfo:(store,userInfo)=>{
       store.commit("SET_USERINFO",userInfo)
     }
  },
  mutations: {
    SET_TOKEN:(state,token)=>{
       state.token = token;
    },
    SET_USERINFO:(state,userInfo)=>{
      state.userInfo = userInfo;
    }
  },
};
